package priv.lirenhe.javasuper.thread.other;

public class TaskYield implements Runnable{

	public TaskYield() {
		System.out.println("TaskYield init");
	}

	@Override
	public void run() {
		int i = 0;
		while(true){
			System.out.println(Thread.currentThread().getName() + "执行：" + i++);
			
			synchronized (this) {
				if(i == 10 && Thread.currentThread().getName().equals("maxP")){
					System.out.println("maxP yield:让步给其他线程执行：只是进入就绪状态，没有进入阻塞状态");
					Thread.yield();
				}
			}
		}
		
	}
	
	

}
